package com.pjj.messageservice.controller;

import com.pjj.messageservice.entity.Message;
import com.pjj.messageservice.service.MessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.socket.WebSocketHandler;

/**
 * @author 76004
 * @apiNote
 * @date 2023/2/27 19:29
 */
@RestController
@RequestMapping("/message")
public class MessageController {
    @Autowired
    private MessageService messageService;

    @Autowired
    private WebSocketHandler emailWebSocketHandler;

    @PostMapping("/sendMessage")
    public Object sendMessage(Message message){
        return messageService.sendMessage(message);
    }

    @PostMapping("/replyMessage")
    public Object replyMessage(Message message){
        return messageService.replyMessage(message);
    }



}
